﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>ECharts.js 数据绑定</title>
    <meta charset="utf-8">
    <script type="text/javascript" src="js/echarts.js"></script>
</head>
<body style="overflow:Scroll;overflow-y:hidden;overflow-x:hidden;">
<div id="chartmain" style="width:600px; height: 400px;"></div>
<script type="text/javascript">
    //初始化echarts实例
    var myChart = echarts.init(document.getElementById('chartmain'));



    //指定图标的配置和数据
    option = {
        title:{
            text: '数量',
            left: 30,
            top: 20,
            textStyle: {
                color: '#ccc'
            }
        },
        tooltip: {},
        legend:{
            data:['数据量']
        },
        xAxis:{
            data:${data.categories}
        },
        yAxis:{},
        series:[
            {
                name:'数据量',
                type:'bar',
                data:${data.data}
            }
        ]
    };

    //使用制定的配置项和数据显示图表
    myChart.setOption(option);
</script>
</body>
</html>
